1. Field of the Invention
This invention relates to systems and methods for determining the media type of removable magnetic media that is inserted into internal devices of a computer system. Specifically, this invention relates to Basic Input/Output System (BIOS) software for determining the media type of a diskette placed in a computer disk drive wherein the media type is presumed to be of a known type and, if not, is determined after a diskette access failure.
2. Description of the Related Art
Personal computers have become an integral part of many offices and homes. As computer technology advances, new products are introduced at ever increasing rates. One type of rapidly developing technology relates to data storage. Because computer systems need to maintain program data in non-volatile types of storage, advances in data storage media have become an important component of computer development. Two of the most prominent types of storage used in personal computers today are hard disks and floppy diskettes.
As is known, hard disk drives are normally non-removable magnetic storage media comprising the main storage area for personal computers. Most computer programs and their associated data are stored on hard disks because they can hold tremendous amounts of information. Currently available hard disks for personal computer applications can store up to two gigabytes of information.
Floppy diskettes normally have a lower capacity than hard disks and are portable between personal computers. Most floppy diskettes are used to transport software between computer systems. As the data capacity of hard disks has increased over the past decade, floppy diskette data capacity has also gone up. For example, the first personal computers could only store about 360 thousand bytes of information on a single floppy diskette. However, current floppy diskettes can hold up to 2.8 million bytes of information.
The ability of current floppy diskettes to store more information than older diskettes is due to advances in data storage technology. Although the physical size of the media has been relatively constant, the amount of data that can be stored on that media has increased. Thus, the higher capacity diskettes are formatted to hold more data than their predecessors. Diskette formatting routines separate the diskette into tracks and sectors as is known in the art. Previous diskettes were formatted with 48 tracks per inch of media, while current diskettes are formatted to have 96 tracks per inch of media. Thus, the physical layout of the various diskettes differs depending on the diskette""s capacity.
One problem associated with the increase in floppy diskette capacity is compatibility. Floppy disk drive manufacturers want to sell a product that can read floppy diskettes with a wide range of media capacities. Although floppy disk drives are now available that can read different capacity floppy diskettes, it has remained a problem for personal computers to determine what capacity of media is in the floppy disk drive so that the data can be read properly. The computer needs to be programmed to determine which media type (eg. capacity) of diskette has been inserted into the floppy disk drive so that it can read the media without errors.
One system for determining the type of diskette inserted in a floppy disk drive is described in U.S. Pat. No. 4,773,036 to Berens. The method described in this patent determines the diskette""s media type every time a new diskette is placed into the floppy drive. The floppy disk controller described in the Berens patent sends a signal to the computer BIOS every time the floppy disk drive door is opened. This xe2x80x9cdisk changexe2x80x9d signal indicates to the computer that a new diskette has been inserted into the floppy disk drive. Every time that the computer receives an indication that the floppy diskette has changed it runs a media checking routine to determine the media type of the new diskette. Thus, the computer cycles through a media checking process every time a new diskette is inserted into the floppy disk drive.
This media checking process has several disadvantages because it is likely that different diskettes of the same capacity will be used in the disk drive, even though the actual diskette itself is different. By checking the media type of every new diskette that is inserted, the computer wastes processing time since it is likely that the consumer will use the same capacity diskette most of the time.
Thus, there is a need for a computer system that is flexible enough to read floppy diskettes of varying capacities, but does not waste computer overhead by checking the media type of the floppy diskette whenever a new diskette is inserted into the floppy disk drive.
The present invention includes a system for determining the media type of a removable magnetic media that is inserted into an internal device in a computer system. In one embodiment, the removable magnetic media is a floppy diskette and the internal device is a floppy disk drive. As discussed above, prior art systems checked the floppy diskette""s media type every time a new floppy diskette was inserted into the floppy drive. However, the system of the present invention only checks the media type if a data error is reported while reading the removable magnetic media, thereby reducing system overhead and decreasing access times to the removable magnetic media.
One embodiment of the invention is a method for reading data from a removable magnetic media, including the steps of: reading first data from a removable magnetic media; determining whether a data error has occurred during the reading first data step; obtaining the media type of the removable magnetic media if and only if a data error occurred; attempting to read second data using the obtained media type; and storing the obtained media type.
Another embodiment of the invention is a system in a computer system for determining the media type of a removable magnetic media The system includes an internal device capable of reading removable magnetic media with different media types and includes: an error status indicator indicative or a data error occurring during an attempted read of the removable magnetic media and firmware responsive to the error status indicator for determining the media type of the removable magnetic media.
Yet another embodiment of the present invention is a computer circuit in communication with a controller, wherein the computer circuit includes: a memory that stores information relating to the media type of a removable magnetic media; first firmware that instructs the controller to read data from the removable magnetic media, wherein the controller returns a data error code if said data cannot be read properly; second firmware that instructs the controller to access the removable magnetic media and determine the media type of the removable magnetic media when the controller has returned a data error code; and third firmware that obtains the determined media type and stores the media type in the memory.
An additional embodiment of the present invention is a Basic Input/Output System (BIOS) for a personal computer system, including: a memory for storing information relating to the media type of a removable magnetic media; first firmware for instructing an internal device to read data from the removable magnetic media, wherein the internal device returns a data error code if the data read includes errors; second firmware responsive to the data error code for determining the media type of the removable magnetic media; and third firmware for storing the determined media type in the memory.
Still another embodiment of the present invention is a method in a computer system for reading data from a removable diskette that has been inserted into a disk drive, including the steps of: reading a first diskette in the disk drive, wherein the first diskette is read by reference to a chosen media type; reading a second diskette that has been inserted in the disk drive; attempting to read data from the second diskette by reference to the chosen media type; determining whether a data error has occurred in attempting to read the second diskette; and successfully completing the read operation if the data error did not occur.
An additional embodiment of the invention is a computer system, including: an internal device capable of reading removable magnetic medias of different media types; controller in communication with the internal device, wherein the controller is configured to read data from a removable magnetic media in the internal device using a chosen data transfer rate; an error status indicator generated by the controller in response to a data error occurring while the internal device performs a read operation on the removable magnetic media; firmware for determining whether an error status indicator was generated during the read operation and successfully completing the read operation if no error code was generated.
Yet another embodiment of the invention is an apparatus for determining the media type of a removable magnetic media in a computer system wherein an internal device is in communication with a controller and the internal device is operable with a plurality of removable magnetic medias having different media types, including: a first memory for storing information relating to the media type of a removable magnetic media; means for transferring data from the removable magnetic media to a second memory and returning a data error code if the data includes errors; means responsive to the data error code for determining the media type of the removable magnetic media; and means for storing the determined media type in the first memory.
One further embodiment of the invention is within a computer system having a disk drive in communication with a disk drive controller, the disk drive being operable with a plurality of diskette types, a method for adapting the system to changes in the diskette in the disk drive, the method including the steps of: reading data from the diskette, wherein the reading step includes identifying data errors; determining the media type of the diskette if a data error occurs during the reading step; attempting to re-read the data using the determined media type; and updating a memory in the computer with the determined media type if the data is successfully read from the diskette during the attempting step.
Another embodiment of the invention is a computer circuit in communication with a controller, wherein the circuit includes: a memory for storing information relating to the media type of a removable magnetic media; first firmware for instructing the controller to read data from the removable magnetic media, wherein the controller returns a data error code if the data cannot be read properly; second firmware for instructing the controller to access the removable magnetic media and determine the media type of the removable magnetic media when the controller has returned a data error code; and third firmware for obtaining the determined media type and storing the media type in the memory.